package pro.uccs.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import pro.uccs.constant.OCConstant;
import pro.uccs.constant.OpenPlatformConstant;
import pro.uccs.entity.MessageInfo;
import pro.uccs.util.SymmetricEncoder;
import java.io.IOException;

@Controller
@RequestMapping()
public class CallBackController {

    /**
     * 接收回调服务
     */
    @RequestMapping(value = "/test", method = RequestMethod.POST)
    @ResponseBody
    public void test(@RequestBody MessageInfo messageInfo)  {
        System.out.println(messageInfo.getEncrypt());
        System.out.println(SymmetricEncoder.decrypt(OpenPlatformConstant.OPEN_CALLBACK_DATA_KEY,messageInfo.getEncrypt()));
    }
}
